package salary

import "reflect"

type TimeCardTransaction struct {
	EmployeeId int
	TimeCard   TimeCard
}

func GetTimeCardTransaction(employeeId int, timeCard TimeCard) *TimeCardTransaction {
	return &TimeCardTransaction{
		employeeId, timeCard,
	}
}

func (t *TimeCardTransaction) Execute() {
	e := GetDB().GetEmployee(t.EmployeeId)
	classification := e.PaymentClassification
	hourType := reflect.TypeOf(HourlyClassification{})
	if reflect.TypeOf(classification) != hourType {
		panic("关联失败，雇员不是钟点工")
	}
	//append(classification.GetTimeCards(), t.TimeCard)
}
